<template>
	<view class="dt">
		<view class="title">基本信息：</view>
		<u-cell-group>
			<u-cell title="单号：" :value="list.order_number"></u-cell>
			<u-cell class="hasStu" title="门诊：" :value="list.title"></u-cell>
			<u-cell title="订单类型：" v-if="list.is_huizhen == '1'" value="会诊订单"></u-cell>
			<u-cell title="状态：" v-if="list.status == '0'" value="待支付"></u-cell>
			<u-cell title="状态：" v-else-if="list.status == '1'" value="待接单"></u-cell>
			<u-cell title="状态：" v-else-if="list.status == '1'" value="待发药"></u-cell>
			<u-cell title="状态：" v-else-if="list.status == '1'" value="已发药"></u-cell>
			<u-cell title="状态：" v-else-if="list.status == '1'" value="已签收"></u-cell>
			<u-cell title="状态：" v-else value="已完成"></u-cell>
			<u-cell class="hasNoData" title="会诊佣金：" v-if="list.is_huizhen == '1'" :value="'￥'+list.huizhen.price2"></u-cell>
			<u-cell class="hasNoData" title="实付金额：" :value="'￥'+list.price"></u-cell>
			<u-cell title="患者付款：" :value="list.pay_time"></u-cell>
			<u-cell title="药房接单：" :value="list.jiedan_time"></u-cell>
			<u-cell title="签收：" :value="list.qianshou_time"></u-cell>
		</u-cell-group>
		
		<view class="title">患者信息：</view>
		<u-cell-group>
			<u-cell class="hasStu" title="患者姓名：" :value="list.user.name + list.user.nianling"></u-cell>
			<u-cell title="患者性别：" v-if="list.user.sex == 1" value="男"></u-cell>
			<u-cell title="患者性别：" v-else value="女"></u-cell>
			<u-cell title="中医诊断：" :value="list.kaifang.zhenduan"></u-cell>
		</u-cell-group>
		
		<view class="title">医生信息：</view>
		<u-cell-group>
			<u-cell class="hasStu" title="医生姓名：" :value="list.ys.name"></u-cell>
			<u-cell title="当前职称：" :value="list.ys.technical_title_id_str"></u-cell>
			<u-cell title="所属门诊：" :value="list.ys.company_title"></u-cell>
			<u-cell title="所属科室：" :value="list.ys.section_id_str"></u-cell>
			<u-cell title="联系电话：" :value="list.ys.phone"></u-cell>
		</u-cell-group>
		
		<view class="title">开方信息：</view>
		<u-cell-group>
			<u-cell v-for="(i,k) in list.kaifang_list" :key="k" class="hasStu" :title="'药材'+'：'" :value="i.name+' '+i.num+'g'+' '+i.yongfa"></u-cell>
		</u-cell-group>
	
		<view class="title">处方信息：</view>
		<u-cell-group>
			<u-cell title="方剂类型：" :value="list.type"></u-cell>
			<u-cell title="剂型：" :value="list.type"></u-cell>
			<u-cell title="取药方式：" value="快递"></u-cell>
			<u-cell title="用法：" v-if="list.yongfa == 0" value="内服"></u-cell>
			<u-cell title="用法：" v-else value="外用"></u-cell>
			<u-cell title="剂数：" :value="list.kaifang.jishu+'剂'"></u-cell>
			<u-cell title="每日：" :value="list.kaifang.meiri+'剂'"></u-cell>
			<u-cell title="一剂分几次：" :value="list.kaifang.jifen+'次'"></u-cell>
			<u-cell title="每次多少：" :value="list.kaifang.meici+'ml'"></u-cell>
			<u-cell title="医嘱：" :value="list.kaifang.yizhu"></u-cell>
		</u-cell-group>
		
		<view v-if="list.kuaidi_name">
			<view class="title">快递信息：</view>
			
			<u-cell-group>
				<u-cell title="快递公司：" value="顺丰快递"></u-cell>
				<u-cell v-if="list.kuaidi_num" title="快递单号：" :value="list.kuaidi_num"></u-cell>
				<u-cell title="收货人：" :value="list.kuaidi_name"></u-cell>
				<u-cell title="手机号码：" :value="list.kuaidi_phone"></u-cell>
				<u-cell title="收货地址：" :value="list.province_name+list.city_name+list.area_name+list.address"></u-cell>
				<!-- <view v-if="wlxx.length!=0">
					
				</view> -->
			</u-cell-group>
			
			
			<!-- <uni-list>
				<view v-if="wlxx.length!=0">
					<uni-list-item class="hasMsg" title="物流信息：" rightText="">
						<template slot="footer">
							<view class="docSign2">
								<view class="text" v-for="(i,k) in wlxx" :key="k">{{i.time}}：{{i.context}}</view>
							</view>
						</template>
					</uni-list-item>
				</view>
			</uni-list> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:{
					user:{
						name:"",
						technical_title_id_str:"",
						company_title:"",
						section_id_str:"",
						phone:""
					},
					ys:{
						name:"",
						nianling:""
					},
					kaifang:{
						zhenduan:'',
						yongfa:'',
						jishu:'',
						meiri:'',
						jifen:'',
						meici:'',
						yizhu:'',
					}
				},
				wlxx:[]
			}
		},
		onLoad(options) {
			this.detail(options.id)
		},
		methods: {
			async detail(id) {
				let res = await this.$api.cfxq({oid: id});
				if (res.code == 200) {
					this.list = res.data
					if(this.list.kd_content){
						this.wlxx = JSON.parse(this.list.kd_content).data.data
					}
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.dt{
		padding:1upx 30upx;
		font-size: 30upx;
		line-height: 160%;
		
		.title{
			font-size: 32upx;
			font-weight: bold;
			margin: 30upx 0;
		}
		
		::v-deep .hasNoData{
			.u-cell__value{
				color: #F86C53;
			}
		}
		::v-deep .hasStu{
			.u-cell__value{
				color: #0000FF;
			}
		}
		
		::v-deep .u-cell__title-text {
			font-size: 30upx;
			color: #000000;
			white-space: nowrap;
		}
		
		.docSign2{
			text-align: justify;
			width: 500upx;
			
			.text{
				margin-bottom: 15upx;
				font-size: 28upx;
				color: #9F9F9F;
			}
		}
		
	}
	
</style>
